package net.adetech.dcweb.core.${DBEntity.packageName}.controller;

import net.adetech.dcweb.core.${DBEntity.packageName}.entity.${DBEntity.pascalName};
import net.adetech.dcweb.core.${DBEntity.packageName}.service.I${DBEntity.pascalName}Service;
import net.adetech.utils.UtilsCommon;
import net.adetech.utils.spring.PageBean;
import net.adetech.web.utils.spring.BaseController;
import net.adetech.web.utils.UtilsUI;
import net.adetech.web.utils.UtilsWeb;
import net.adetech.utils.UtilsCondition;
import org.springframework.ui.Model;
import com.alibaba.fastjson.JSONObject;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Created by auto on 2016/10/21.
*/
@Controller
public class ${DBEntity.pascalName}Controller extends BaseController {

private final Logger logger = LoggerFactory.getLogger(${DBEntity.pascalName}Controller.class);

@RequiresPermissions({"${DBEntity.system}:${DBEntity.module}:add", "${DBEntity.system}:${DBEntity.module}:view"})
@RequiresRoles({"systemAdmin"})
@GetMapping("/${DBEntity.system}/${DBEntity.module}/create")
public String create() {
return "${DBEntity.fodlerName}/edit";
}

@RequiresPermissions({"${DBEntity.system}:${DBEntity.module}:add","${DBEntity.system}:${DBEntity.module}:update","${DBEntity.system}:${DBEntity.module}:view"})
@RequiresRoles({"systemAdmin"})
@GetMapping("/${DBEntity.system}/${DBEntity.module}/edit/{id}")
public String edit(Model model,@PathVariable Long id) {
return "${DBEntity.fodlerName}/edit";
}

@RequiresPermissions({"${DBEntity.system}:${DBEntity.module}:view"})
@RequiresRoles({"systemAdmin"})
@GetMapping("/${DBEntity.system}/${DBEntity.module}/list")
public String list() {
return "${DBEntity.fodlerName}/list";
}
}